﻿using SecurityLog.Biz;
using SecurityLog.Models;
using SecurityLog.Repositories;

namespace SecurityLog.Factory
{
    public class UserFactory
    {
        public static Biz.Users GetUserFromRepository(int id)
        {
            var usersRepository = new UsersRepository();
            var userDto = usersRepository.GetUserById(id);

            return new Users(userDto.Name, userDto.Initials, userDto.Entries != null && userDto.Entries.Count > 0);
        }
    }
}